home *** CD-ROM | disk | FTP | other *** search
- /* UNIX2DOS.C --- p. 675 */
- #include <dos.h>
- #include <time.h>
- void main()
- {
- struct date date;
- struct time timep;
- time_t tunix;
- /* Get date and time in UNIX format */
- time(&tunix);
- /* Convert to DOS style date and time */
- unixtodos((long)tunix, &date, &timep);
- /* Print date and time */
- printf("Current date: %d-%d-%d\n", date.da_mon, date.da_day,
- date.da_year);
- printf("Current time: %d:%d:%d:%d\n", timep.ti_hour, timep.ti_min,
- timep.ti_sec, timep.ti_hund);
- }